home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / nxyplot1.87 / Plot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-21  |  6.7 KB  |  226 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import <objc/Object.h>
  5. #import <appkit/nextstd.h>    /* gets stdio */
  6. #import <appkit/Form.h>        /* for NXCoord, etc. */
  7. #import <appkit/color.h>
  8. #import "ScrollWindow.h"        // added 10-7-91 by pdhowell
  9.  
  10. typedef struct _datahunk {
  11.     char  *filename;
  12.     float *x;
  13.     float *ex;            /* for error bars */
  14.     float **y;
  15.     float **ey;            /* for error bars */
  16.     int   npoints;
  17.     int   ncurves;
  18.     NXPoint datamin;
  19.     NXPoint datamax;
  20.     BOOL    xaxislin;
  21.     BOOL    yaxislin;
  22.     BOOL    has_exbars;        /* for error bars */
  23.     BOOL    has_eybars;        /* for error bars */
  24. } datahunk;
  25.  
  26. @interface Plot:Object
  27. {
  28.     id  datahunkArray;        /* array of datahunk structs (a Storage object) */
  29.     id    yMax;            /* the yMax object */
  30.     id    xMax;            /* the xMax object */
  31.     id    canvas;            /* the PlotView object */
  32.     id    yMin;            /* the yMin object */
  33.     id    xMin;            /* the xMin object */
  34.     id    yInc;            /* the yInc object */
  35.     id    xInc;            /* the xInc object */
  36.     id  lineText;        /* the lineText object */
  37.     id  symbolText;        /* the symbolText object */
  38.     id  lineMatrix;        /* the lineMatrix object */
  39.     id  symbolMatrix;        /* the symbolMatrix object */
  40.     id  plotButton;        /* the plot Button object */
  41.     id  xLinLog;        /* the x-axis linear/logarithmic button */
  42.     id  yLinLog;        /* the y-axis linear/logarithmic button */
  43.     id  legendForm;        /* for the curve titles on the legend */
  44.     id  changeLegendFont;    /* the change legend font on/off button */
  45.     id  changeLegendTitleFont;    /* the change leg. title font on/off button */
  46.     id  changeXTitleFont;    /* the change x title font on/off button */
  47.     id  changeYTitleFont;    /* the change y title font on/off button */
  48.     id  changeMainTitleFont;    /* the change main title font on/off button */
  49.     id  changeTicLabelFont;    /* the change tic label font on/off button */
  50.     id  curveNumber;        /* the TextField on the color panel */
  51.     id  curveColorWell;        /* color well for the curves */
  52.     id  backgroundColorWell;    /* color well for background */
  53.     id  textColorWell;        /* color well for text */
  54.     id  columnPanel;        /* the Column Selection panel */
  55.     id  columnSelectionHandler;    /* manages the Column Selection panel */
  56.     id  accPrintColorButton;    /* print color button on accessories panel */
  57.     id  accPrintLineStyleButton;/* line style button on accessories panel */
  58.     id  printPreview;        /* are we previewing before printing? */
  59.     id  binaryOpenAccessory;    /* accessory view for binary open */
  60.     id  binaryOpenForm;        /* how many curves in the binary file */
  61.     id  binaryXdatathere;    /* is there X data in the binary file? */
  62.     id  writeDataAccButton;    /* should we write ascii or binary? */
  63.     id  errorBars;        /* the error bars pop-up list*/
  64.     id  errorBarPanel;        /* the panel with information about error bars */
  65.     id  errorBarHandler;    /* manages the error bar panel */
  66.     id  fileRemovalPanel;    /* for selective file removal */
  67.     id  fileRemovalMatrix;         /* filenames in file removal window */
  68.     id  fileRemovalButtons;    /* buttons for clicking on filenames */
  69.  
  70.     int ncurvestotal;        /* total number of curves  */
  71.     int nfilestotal;        /* total no. of files "open" */
  72.  
  73.     NXPoint globaldatamin;    /* xmin and ymin from the data */
  74.     NXPoint globaldatamax;    /* xmax and ymax from the data */
  75.  
  76.     NXPoint oldMin;        /* for use by "previous view" */
  77.     NXPoint oldMax;        /* ditto */
  78.     NXPoint oldInc;        /* ditto */
  79.     NXPoint currentMin;        /* ditto */
  80.     NXPoint currentMax;        /* ditto */
  81.     NXPoint currentInc;        /* ditto */
  82.  
  83.     int beepError;
  84.  
  85.     NXColor backgroundcolor, textcolor;
  86.     NXColor *curvecolors;
  87.     BOOL colorOption;
  88.  
  89. // these lines added by pdhowell
  90.     id  lineMatrixWindow;         /* the lineMatrix object's Window */
  91.     id  symbolMatrixWindow;       /* the symbolMatrix object's Window */
  92.     id  legendFormWindow;         /* the legendForm object's Window */
  93. }
  94.  
  95. /* class methods */
  96. + initialize;
  97.  
  98. /* instance methods */
  99. - init;
  100. - makeSomeScrollWindows;     // added by pdhowell
  101.  
  102. - (NXCoord *)xdata:(int)n;
  103. - (NXCoord *)exdata:(int)n;
  104. - (NXCoord **)ydata:(int)n;
  105. - (NXCoord **)eydata:(int)n;
  106. - (BOOL)has_exbars:(int)n;
  107. - (BOOL)has_eybars:(int)n;
  108.  
  109. - (int) nPoints:(int)n;
  110. - (int) nCurves:(int)n;
  111. - (char *) filename:(unsigned)n;
  112. - (int) nCurvesTotal;
  113. - (int) nFiles;
  114.  
  115. - makeLineStyle:(int)aCurve :(int)lineStyle;
  116. - makeSymbolType:(int)aCurve :(int)symType;
  117.  
  118. - (BOOL) xaxisLog;
  119. - (BOOL) yaxisLog;
  120. - forceXaxisLinear;
  121. - forceYaxisLinear;
  122. - forceXaxisLog;
  123. - forceYaxisLog;
  124. - (BOOL) shouldChangeLegendFont;
  125. - (BOOL) shouldChangeLegendTitleFont;
  126. - (BOOL) shouldChangeXTitleFont;
  127. - (BOOL) shouldChangeYTitleFont;
  128. - (BOOL) shouldChangeMainTitleFont;
  129. - (BOOL) shouldChangeTicLabelFont;
  130.  
  131. - (int)providelinestyle: (int)aCurve;
  132.                 /* 0=solid, 1=dash, 2=dot, 3=chain dash */
  133.                 /* 4=chain dot, 5=none : see defs.h */
  134. - (int)providesymbolstyle: (int)aCurve;
  135.                 /* 0=none, 1=circle, 2=x, 3=up triangle */
  136.                 /* 4=down triangle, 5=diamond, 6=square  */
  137.                 /* 7=plus : see defs.h */
  138.  
  139. - (double)provideXmin;
  140. - (double)provideXmax;
  141. - (double)provideXinc;
  142. - (double)provideYmin;
  143. - (double)provideYmax;
  144. - (double)provideYinc;
  145.  
  146. - (float)provideGlobalXmin;
  147. - (float)provideGlobalYmin;
  148.  
  149. - resetXmin:(double)x;
  150. - resetXmax:(double)x;
  151. - resetXinc:(double)x;
  152. - resetYmin:(double)x;
  153. - resetYmax:(double)x;
  154. - resetYinc:(double)x;
  155.  
  156. - resetMinMax:sender;
  157.  
  158. - drawPlotButton:(int)state;
  159.  
  160. - drawPlot:sender;
  161.  
  162. - (int) readData:(NXStream *)aDataStream  :(char *)fname;
  163.  
  164. - checkLinLog:(datahunk *)pdh;
  165. - checkGlobalLinLog;
  166.  
  167. - findMinMax:(datahunk *)pdh;
  168. - findGlobalMinMax;
  169. - niceMinMaxInc;
  170.  
  171. - adjustLineStyleMatrix:(int)column :(int)row;
  172. - adjustSymbolTypeMatrix:(int)column :(int)row;
  173. - redisplayLineStyleMatrix;
  174. - redisplaySymbolTypeMatrix;
  175. - adjustPanels:(int)oldn :(int)newn;
  176.  
  177. - open:sender;
  178.  
  179. - openFile:(char *)dataFile :(char *)realName;
  180.  
  181. - plotPrepAndDraw;
  182.  
  183. - removeAllFiles:sender;
  184.  
  185. - fixFileRemovalPanel:sender;
  186.  
  187. - removeSomeFiles:sender;
  188.  
  189. - removeAndOpen:sender;
  190.  
  191. - sanityCheck;
  192.  
  193. - writeDataFiles:sender;
  194.  
  195. - (NXColor) provideBackgroundColor;
  196. - (NXColor) provideTextColor;
  197. - (NXColor) provideCurveColor:(int)aCurve;
  198.  
  199. - setBackgroundColor:sender;
  200. - setTextColor:sender;
  201. - setCurveColor:sender;
  202. - forceBackgroundColor:(NXColor)aColor;
  203. - forceTextColor:(NXColor)aColor;
  204. - forceCurveColor:(int)curvenum :(NXColor)aColor;
  205.  
  206. - colorOn:(BOOL)onOff;
  207.  
  208. - fixMatrixColumn:sender;
  209.  
  210. - swapColumns:(int)prev_col :(int)col forFileNumber:(int)i;
  211.  
  212. - stackOldMinMax:(float)xmin :(float)xmax :(float)ymin :(float)ymax;
  213.  
  214. - openBinary:sender;
  215.  
  216. - openBinaryFile:(char *)dataFile;
  217.  
  218. - (int) readBinaryData:(NXStream *)aDataStream :(char *)fname :(int)numcurves
  219.                       :(int)numpoints :(BOOL)xdatathere;
  220.  
  221. - preludeToReading:(char *)fname :(datahunk **)pdh;
  222.  
  223. - postludeToReading:(char *)fname :(int)oldncurves :(datahunk *)pdh;
  224.  
  225. @end
  226.